class SyncHook {
    events = [];

    constructor() {
        console.log('SyncHook');
    }

    tap(name, cb) {
        cb = typeof cb === 'function' ? cb : (...args) => args;
        this.events.push(cb);
    }

    call(...args) {
        this.events.forEach((cb) => {
            cb(...args);
        })
    }
}

module.exports = SyncHook;